home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1987 November
/
1987-11.d64
/
sketch-pad menu
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
3KB
|
129 lines
10 rem copyright 1987 compute! publications, inc. - all rights reserved
20 ifl>0then60
30 poke52,32:poke56,32:poke252,0:clr
40 print"[147] copyright 1987 compute! pub., inc."
50 printtab(10)"all rights reserved"
60 gosub130
70 gosub300
80 ifcm=7then110
90 poke845,pr(1):poke846,pr(2):poke53287,pr(1):sys32768
100 goto70
110 input"[147]exit (y/n)";fc$:iffc$<>"y"then70
120 print"[147]processing complete":poke251,0:end
130 ifpeek(251)=86thenpoke839,0:goto190
140 ifl=0thenl=1:load"sketch-pad",8,1
150 ifl=1thenl=2:load"savesketch",8,1
160 ifl=2thenl=3:load"printsketch",8,1
170 forc1=1to128:readsp:poke16255+c1,sp:next
180 poke839,1:poke833,1:poke840,50
190 cm$(1)="paint color":pr(1)=0
200 cm$(2)="background color":pr(2)=14
210 cm$(3)="save sketch"
220 cm$(4)="save transfer"
230 cm$(5)="load sketch"
240 cm$(6)="load transfer"
250 cm$(7)="exit to basic"
260 ifpeek(251)<>86thencm=1
270 poke251,86
280 ba=27998:poke878,peek(ba):poke879,peek(ba+1)
290 return
300 poke53280,6:poke53281,6:print"[147][159]"
310 print""tab(15)"[144]sketch pad"
320 ifcm=0thencm=1
330 forc1=1to7:print" "
340 ifc1<3thenprinttab(20);:ford=1to16:poke646,d:print" [146]";:next:print:goto360
350 print" "
360 print"[159]";:ifc1=cmthenprint"";
370 printcm$(c1)
380 next
390 print""
400 printtab(24)"[144]f1-sketch"
410 printtab(24)"f7-print[159]"
420 gosub930
430 getfc$
440 iffc$="[133]"thenifcm=7thencm=1
450 iffc$="[133]"then920
460 iffc$="[136]"thengosub1040:goto300
470 ifpeek(56320)=127then430
480 j1=peek(56320)
490 if(j1or239)=239then630
500 if(j1or247)=247then610
510 if(j1or251)=251then580
520 if(j1or253)=253then560
530 if(j1or254)<>254then430
540 cm=cm-1:ifcm<1thencm=7
550 goto310
560 cm=cm+1:ifcm>7thencm=1
570 goto310
580 ifcm>2then430
590 pr(cm)=pr(cm)-1:ifpr(cm)<0thenpr(cm)=15
600 goto420
610 pr(cm)=pr(cm)+1:ifpr(cm)>15thenpr(cm)=0
620 goto420
630 ifcm=7then920
640 ifcm<3then430
650 print"[147]";cm$(cm);"":fc$=""
660 input"file name";fc$:iffc$=""then300
670 ifcm=3orcm=5thenfc$="sp."+left$(fc$,12)
680 ifcm=4orcm=6thenfc$="sx."+left$(fc$,12)
690 open15,8,15
700 open2,8,2,fc$+",p,r":input#15,e,e$
710 close2:close15
720 ife>0thenifcm>4then870
730 ife=0thenifcm<5then870
740 ifcm>4thenloadfc$,8,1
750 pk=17950:pokepk,(len(fc$))
760 print"saving ";fc$;""
770 ifcm=3thenba=8192:ea=ba+8000
780 ifcm=4thenba=27998:ea=ba+int((peek(878)/8)*peek(879))+10
790 bh=int(ba/256):bl=ba-(bh*256)
800 eh=int(ea/256):el=ea-(eh*256)
810 poke18030,bl:poke18034,bh:poke18038,el:poke18040,eh
820 forc1=1tolen(fc$):pokepk+c1,asc(mid$(fc$,c1,1)):next
830 ifcm=4thenpokeba,peek(878):pokeba+1,peek(879)
840 sys18000
850 ifpeek(pk)=0then300
860 print"bad save":goto880
870 printe;e$;""
880 print"press return to continue"
890 getfc$:iffc$<>""then890
900 getfc$:iffc$=""then900
910 goto300
920 return
930 print""
940 printtab(20);
950 forc1=0to15:ifc1=pr(1)thenprint"^";:goto970
960 print" ";
970 next
980 print""
990 printtab(20);
1000 forc1=0to15:ifc1=pr(2)thenprint"^";:goto1020
1010 print" ";
1020 next
1030 return
1040 print"[147]sketch print process"
1050 print"print picture l[146]-large or s[146]-small?"
1060 getfc$:iffc$<>""then1060
1070 getfc$:iffc$=""then1070
1080 iffc$="l"thenpoke49220,0:goto1110
1090 iffc$="s"thenpoke49220,1:goto1110
1100 goto1120
1110 sys49300
1120 return
1130 data0,0,0,0,0,0,0,0
1140 data0,0,0,0,0,0,0,0
1150 data0,0,0,0,0,255,128,0
1160 data160,192,0,160,224,0,160,192
1170 data0,255,128,0,0,0,0,0
1180 data0,0,0,0,0,0,0,0
1190 data0,0,0,0,0,0,0,0
1200 data0,0,0,0,0,0,0,128
1210 data0,0,0,0,0,0,0,0
1220 data0,0,0,0,0,0,0,0
1230 data0,0,0,0,0,0,3,255
1240 data0,6,5,0,14,5,0,6
1250 data5,0,3,255,0,0,0,0
1260 data0,0,0,0,0,0,0,0
1270 data0,0,0,0,0,0,0,0
1280 data0,0,0,0,0,0,0,128